let fib = Seq.unfold (fun (cur, next) -> Some(cur, (next, cur+next))) (1, 2)
let prFib n = fib |> Seq.take n |> Seq.toList |> printf "%A\n"

let even n = n % 2 = 0

let sol =
  fib
  |> Seq.filter even
  |> Seq.takeWhile (fun n -> n <= 4000000)
  |> Seq.fold (fun acc e -> acc + e) 0

printf "%d\n" sol
